<template>
	<view class="container">
		正在登录...
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		onLoad(options) {
			var appid=options.appid;
			if(!uni.getStorageSync("Token")){
				var Code=this.Util.GetQueryString("code");
				if(Code){
					var data={};
					data.Act="Find_WxUserInfo";
					data.Code=Code;
					this.Util.Common(data, json=>{
						if(json.State){
							uni.setStorageSync("Token",json.Data.Member.Token);
							window.location.href=uni.getStorageSync("Url");
						}else{
							window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+escape(window.location.href)+"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
						}
					});
				}else{
					window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+escape(window.location.href)+"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
				}
			}
		},
		methods:{
			
		}
	}
</script>

<style lang="scss">
	.container{width:100%; padding:50rpx; text-align: center;}
</style>
